using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace WindowsUserControl.UIUpdateWrapper
{
    /// <summary>
    /// 
    /// </summary>
    public class ProgressBarUpdator
    {
        StatusStrip statusStrip;
        ToolStripProgressBar progressBar;
        int percentage;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="strip"></param>
        /// <param name="progress"></param>
        /// <param name="percent"></param>
        public ProgressBarUpdator(StatusStrip strip, ToolStripProgressBar progress, int percent)
        {
            this.statusStrip = strip;
            this.progressBar = progress;
            this.percentage = percent;
            this.statusStrip.Invoke(new MethodInvoker(this.RefreshProgressBar));
        }

        private void RefreshProgressBar()
        {
            this.progressBar.Value = this.percentage;
        }
    }
}
